<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title>MyRemit Cash Card Management System</title>
        <link href="@Href("~/Styles/Site.css")" rel="stylesheet" />
		<link href="@Href("~/css/excite-bike/jquery-ui-1.8.18.custom.css")" rel="stylesheet" />
        <link href="@Href("~/css/jMenu.jquery.css")" rel="stylesheet" />
		<script type="text/javascript"  src="/js/ts_picker.js"></script>
        <script type="text/javascript" src="/js/jquery-1.7.1.min.js"></script>
        <script type="text/javascript" src="/js/jquery-ui-1.8.18.custom.min.js"></script>
        <script type="text/javascript" src="/js/jMenu.jquery.min.js"></script>
        
        
          <script>
         $(function(){
              $("#tabs" ).tabs();
                    /*$("#accordion").accordion({
                    fillSpace:true,
                    //autoHeight:false,
                    });*/
              $("#personal_accordion").accordion();      
              $('#personal_accordion > div').css('height', '220px');
              
              $("#wnf_accordion").accordion();      
              $('#wnf_accordion > div').css('height', '220px');
             
            
          });
        
        
        
        
        
          $(function(){
             $("#buttons").children().button();
            
            
            // simple jMenu plugin called
                $("#jMenu").jMenu({
                    
                    effects : {
                    effectSpeedOpen : 300,
                    effectTypeClose : 'slide'
                    }
                });
                // more complex jMenu plugin called
              
      
          });
        
         
		  
		   function setLookUp(parentid,elem,lookup){
                $.getJSON('/Customer/GetLookup/'+lookup+'/'+$('#'+parentid).val(), function(data) {
                var refData = data;
                $.each(refData, function() {
                var options='';  
                for (var i = 0; i < refData.length; i++) {
                        options+='<option value="' + refData[i].RefID + '">' + refData[i].RefDesc + '</option>';
                    }
                    $('#'+elem).empty();
                    $('#'+elem).html(options);
                });
            });  
          }
        
         function GetLookUp(parent,child,lookup){
            $("select"+parent).change(function(){
             $(child).empty();
            $.getJSON('/Customer/GetLookup/'+lookup+'/'+$(this).val(), function(data) {
                var refData = data;
                if(refData!=""){
                        $.each(refData, function(index, country) {
                        var options="<option id='default'></option>";   
                        for (var i = 0; i < refData.length; i++) {
                                options+='<option value="' + refData[i].RefID + '">' + refData[i].RefDesc + '</option>';
                            }
                           
                            $(child).html(options);
                            $(child).trigger('change');
                        });
                    }else{
                       $(child).empty();
                       $(child).html("<option></option>");
                       $(child).trigger('change');
                    }   
            });
            }//end for region
            
            );//end of change method
            }//end of method GetLookup
            
        function GetParentID(parent,child,lookup){
            $("select#"+parent).change(function(){
            $.getJSON('/Maintenance/GetParentID/'+lookup+'/'+$(this).val(), function(data) {
                var refData = data;
                $.each(refData, function(index, country) {
                var options='';  
                for (var i = 0; i < refData.length; i++) {
                        options+='<option value="' + refData[i].RefID + '">' + refData[i].RefID + '</option>';
                    }
                    $('#'+child).html(options);
                });
            });
            }//end for region
            
            );//end of change method
          }   
			
		function GetSelectedParentID(parent,child,lookup,value){
            $("select#"+parent).val(function(){    
            $.getJSON('/Maintenance/GetParentID/'+lookup+'/'+$(this).val(), function(data) {
                var refData = data;
                $.each(refData, function(index, country) {
                var options='';  
                for (var i = 0; i < refData.length; i++) {
                        if (value == refData[i].RefID){
                            options+='<option value="' + refData[i].RefID + '" selected="selected">' + refData[i].RefDesc + '</option>';
                        }
                        else{options+='<option value="' + refData[i].RefID + '">' + refData[i].RefDesc + '</option>';}
                        
                    }
                    $('#'+child).html(options);
                });
            });
            }//end for region
            
            );//end of change method
            }	
        function applyDatePicker(elem){
          var today=new Date();
          var maxYr = today.getFullYear()+10;
          $(elem).datepicker({
          changeMonth:true,
          changeYear:true,
          showButtonPanel:true,
          yearRange:'-100:+10',
          minDate: new Date(1950,1-1,1),
          maxDate: new Date(maxYr,12-1,31)
        }); 
    }
    
     function showSpinner(){
                    $("#spinner,#spinnerBG").bind("ajaxSend",function(){
                       $(this).show();
                    }).bind("ajaxStop",function(){
                       $(this).hide();
                    }).bind("ajaxError",function(){
                        $(this).hide();
                    });
                }
                
                
     function errorCssOn(elem){
           $(elem).css({"border":"2px solid #be3e16"});
           
     }

    function errorCssOff(elem){
        if($(elem).is("input") || $(elem).is("select")){
             $(elem).css({"border":"1px solid #007c32"});     
        }else{
             $(elem).css({"border":"0px"});
        }
       
    }           
    
    //for Referred by autocomplete
        function getRefByDS(){
            var refList = {};
            $.ajax({
                    url:"/Customer/Services/CustomerService/referby",
                    async:false,
                    cache:false,
                    dataType:'json',
                    success: function(data){
                            var refData = data;
                            $.each(refData, function(key,value) {
                                var refBy = refData[0];
                                refList=refData[0];
                            });
                    }
                });
            
            return refList;
            
        }
        
        function setAutoComplete(elem,elemValue){
                $(elem).autocomplete({
                source:getRefByDS(),
                minLength:0,
                focus: function( event, ui ) {
                        $(elem).val( ui.item.label );
                        return false;
                    },
                select: function( event, ui ) {
                        $(elem).val( ui.item.label );
                        $(elemValue).val( ui.item.value );
                        
                        return false;
                    }
                    
                }).data("autocomplete")._renderItem = function( ul, item ) {
                    return $( "<li></li>" )
                        .data( "item.autocomplete", item )
                        .append( "<a>" + item.label  + "</a>" )
                        .appendTo( ul );
                };  
        }
        
        function clearForm(form) {
            // iterate over all of the inputs for the form
            // element that was passed in
            $(':input', form).each(function() {
                var type = this.type;
                var tag = this.tagName.toLowerCase(); // normalize case
                // it's ok to reset the value attr of text inputs,
                // password inputs, and textareas
                if (type == 'text' || type == 'password' || tag == 'textarea')
                this.value = "";
                // checkboxes and radios need to have their checked state cleared
                // but should *not* have their 'value' changed
                else if (type == 'checkbox' || type == 'radio')
                this.checked = false;
                // select elements need to have their 'selectedIndex' property set to -1
                // (this works for both single and multiple select elements)
                else if (tag == 'select')
                this.selectedIndex = -1;
            });
    }
    
         function showErrorMessage(message){
                $('#message').html("<p class='message error'>"+message+"</p>");
                window.setTimeout(hideMessage,5000);
        }
        function hideMessage(){
            $("#message").empty();
        }
        
        function SetTabs(elem){
             $(elem ).tabs();
        }
        </script>

    </head>
    <body>
        <div id="page">
            <div id="header">
                <a href="@Href("~")"><div class="site-title">MyRemit Cash Card Management System</div></a>
                <div id="login">
                    @if (WebSecurity.IsAuthenticated) {
                        <p>
                            Welcome <a href="@Href("~/Account/ChangePassword")" title="Change password">@WebSecurity.CurrentUserName</a>!
                            <a href="@Href("~/Account/Logout")">Logout</a>
                        </p>
                    } else {
                        <ul>
                            <li><a href="@Href("~/Account/Login")">Login</a></li>
                        </ul>
                    }
                </div>
                <!--<ul id="menu">
                       <li><a href="@Href("~/MainMenu")">Home</a></li>
                    <!--<li><a href="@Href("~/About")">About</a></li>
                    <li><a href="@Href("~/Customer/Index/search")">Customer Management</a>
                        </li>
                    <li><a href="@Href("~/CashCard/Index")">Cash Card Management</a></li>
		    <li><a href="@Href("~/Maintenance/Index")">Reference Table Management</a></li>
                    <li><a href="@Href("~/Reports/Index")">Reports</a></li>
                    @if ( Roles.IsUserInRole("admin")) {
                           <li><a href="@Href("~/Admin/UsersManagement")">Users Management</a></li>
                     }
                    
                </ul>-->
                
                  
                <ul id="jMenu" style="z-index:1">
                    
                    <li><a class="fNiv"  href="@Href("~/Default")"> Home  </a><!-- Do not forget the "fNiv" class for the first level links !! -->
                   
                    <li><a class="fNiv" href="@Href("~/Customer/Index/search")">Customer Management</a></li>
                    <li><a class="fNiv">Cash Card Management</a>
                        <ul>
                            <li class="arrow"></li>
                            <li><a href="/CashCard/Index/searchcc">Extract Cash Cards</a></li>
                            <li><a href="/CashCard/Index/upload">Upload Documents</a></li>
                            <li><a href="/CashCard/Index/files">Downloads</a></li>
                            
                          </ul>
                        </li>
                    <li><a class="fNiv">Reference Table Management</a>
                        <ul>
                            <li class="arrow"></li>
                            <li><a >General Reference Table</a>
                                <ul>
                                     <li><a href="/Maintenance/Index/new">Add and Edit</a></li>
                                     <li><a href="/Maintenance/Index/search">Search And View</a></li>
                                </ul>
                                </li>
                            <li><a>Bank Partner Profile</a>
                                <ul>
                                    <li><a href="/Maintenance/BPProfile">Add Bank Partner Profile</a></li>
                                    <li><a href="/Maintenance/Index/searchbp">Search Bank Partner Profile</a></li>
                                 </ul>
                              </li>
                            <li><a>Courier Profile</a>
                            <ul>
                               <li><a href="/Maintenance/CourierProfile">Add Courier Profile</a></li>
                               <li><a href="/Maintenance/Index/courier_search">Search Courier Profile</a></li>
                            </ul>
                            </li>    
                                
                        </ul>
                        
                        </li>
                    <li><a class="fNiv">Reports</a>
                                <ul>
                                     <li class="arrow"></li>
                                     <li><a href="/Reports/Index/ccml">Cash Card Master List</a></li>
                                     <li><a href="/Reports/Index/vlist">Validation List</a></li>
                                     <li><a href="/Reports/Index/pal">Pending Application List</a></li>
                                     <li><a href="/Reports/Index/aip">Application In-Progress</a></li>
                                    
                                </ul>
                     </li>
                     @if ( Roles.IsUserInRole("admin")) {    
                    <li><a class="fNiv">Admin</a>
                        <ul>
                           <li class="arrow"></li>
                           <li><a href="@Href("~/Admin/UsersManagement")">Manage Users</a></li>
                            <li><a href="@Href("~/Admin/Audit")">Audit Report</a></li>
                            
                             
                            
                        </ul>
                    </li>
                    }
                    </ul
                
            </div>
            <div id="main">
                <div id="content">
                    <h1>@Page.Title</h1>
                    @RenderBody()

                </div>
                <div id="footer" style="clear:both">
                    &copy; April 18, 2012 - myRemit Cash Card Management System
                </div>
            </div>
        </div>
    </body>
</html>